//
//  GRefreshAutoNormalFooter.m
//  DitelHome
//
//  Created by 葛悦彣 on 2022/2/24.
//  Copyright © 2022 Ditel. All rights reserved.
//

#import "GRefreshAutoNormalFooter.h"

@interface GRefreshAutoNormalFooter ()
//
//@property (strong, nonatomic) UIView *line0;
//@property (strong, nonatomic) UIView *line1;
//@property (strong, nonatomic) UIImageView *img;

@end


@implementation GRefreshAutoNormalFooter

- (void)prepare{
    [super prepare];
    
//    self.automaticallyHidden = YES;
    self.refreshingTitleHidden = YES;
    self.stateLabel.font = kFont(14);
    self.stateLabel.textColor = KcolorHex(@"#BBC2CC");
    [self setTitle:@"已经到底啦～" forState:MJRefreshStateNoMoreData];
    [self setTitle:@"" forState:MJRefreshStateIdle];

}

- (void)placeSubviews{
    [super placeSubviews];
    self.automaticallyChangeAlpha = YES;

//    CGFloat width = ceilf([self.stateLabel.text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)
//                                                             options:NSStringDrawingUsesLineFragmentOrigin
//                                                          attributes:@{NSFontAttributeName : self.stateLabel.font}
//                                                             context:nil].size.width) + kwt(20);
         
//    self.img.frame = CGRectMake((self.bounds.size.width - width)/2.0 + kwt(7.5), self.bounds.size.height/2.0 - kwt(7.5), kwt(15), kwt(15));

//    self.line0.frame = CGRectMake(kwt(40) , self.bounds.size.height/2.0, (self.bounds.size.width - width)/2.0 - kwt(47.5), 0.5);
//    
//    self.line1.frame = CGRectMake((self.bounds.size.width + width)/2.0 + kwt(7.5), self.bounds.size.height/2.0, (self.bounds.size.width - width)/2.0 - kwt(47.5), 0.5);
}

- (void)setState:(MJRefreshState)state
{
    [super setState:state];
    
//    self.line0.hidden = self.line1.hidden = self.img.hidden =state != MJRefreshStateNoMoreData;
}

//- (UIView *)line0{
//    if (!_line0) {
//        _line0 = [[UIView alloc]initWithFrame:CGRectZero];
//        _line0.backgroundColor = KcolorHex(@"#BBC2CC");
//        _line0.hidden = YES;
//        [self insertSubview:_line0 belowSubview:self.stateLabel];
//    }
//    return _line0;
//}
//
//- (UIView *)line1{
//    if (!_line1) {
//        _line1 = [[UIView alloc]initWithFrame:CGRectZero];
//        _line1.backgroundColor = KcolorHex(@"#BBC2CC");
//        _line1.hidden = YES;
//        [self insertSubview:_line1 belowSubview:self.stateLabel];
//    }
//    return _line1;
//}
//-(UIImageView *)img {
//    if (!_img) {
//        _img = kimageView(@"BJGL_Footerimg");
//        _img.hidden = YES;
//        [self insertSubview:_img belowSubview:self.stateLabel];
//    }
//    return _img;
//}


@end

